import os

def range2(n):
    i = 0
    while i<n:
        yield i
        i+=1
"""
for x in range2(10):
    print(x)
f = open('test3.py','rt',encoding="utf-8")
for line in f.readlines():
    print(line)
"""
class Path:
    def __init__(self,s):
        self._path_name = s

    def __iter__(self):
        return os.scandir(self._path_name)        
    
for e in Path("."):
    if e.is_dir():
        print("<",e.path,">")
    else:
        print(e.name)
"""
def all_dir(path):
    stack = [path]
    while stack:
        cp = stack.pop()
        for e in os.scandir(cp):
            yield e
            if e.is_dir():                
                stack.append(e.path)

fn = 0
dn = 0
for e in all_dir("."):
    if e.is_dir():
        dn += 1
        print("<",e.path,">")
    else:
        print(e.name)
        fn+=1
print(fn,dn)
"""
#1.打印全部目录树
#for e in all_dir:

#2.文件查找,比如查找文件launch.json

#3.字符串文件查找
